<template>
    <div id="app">
        <router-view></router-view>
        <!--<home></home>-->
    </div>
</template>

<script>
    import Home from "@/components/home/Home.vue"

    import axios from "axios";
    //import jsonp from "jsonp";

    export default {
        name: 'App',
        data() {
            return {
                result: "",
            }
        },
        components: {
            Home
        },
        mounted() {
            this.getUser();
            this.getCartCount();
        },
        methods: {
            getUser() {
                //拉取用户信息
                this.$get('/api/user', {}).then((res) => {
                    //to-do 保存到vuex里面
                    console.log(res);
                });
            },
            getCartCount() {
                this.$get('/api/carts/products/sum', {}).then((res) => {
                    //to-do 保存到vuex里面
                    console.log(res);
                });
            }
        }
    }
</script>

<style lang="scss">
    /*引入scss*/
    @import "./assets/scss/reset.scss";
    @import "./assets/scss/config.scss";
    @import "./assets/scss/button.scss";
</style>
